A forwarding device usually has a forwarding entry that is also referred to as a forwarding information base (FIB) entry. When forwarding a packet, the forwarding device matches a destination address of the packet with an address prefix of a forwarding entry to obtain a matched forwarding entry, and thereby determines a route of the packet based on the matched forwarding entry.
Currently, the forwarding device usually determines a route according to a longest match rule. To be specific, the forwarding device selects a forwarding entry with a longest mask from the forwarding entry that matches the destination address, and determines the route of the packet based on the forwarding entry with a longest mask.
However, in some scenarios, reseach has found that the route of the packet determined based on the forwarding entry with a longest mask is often not an optimal route. However, currently there is no routing control used to select a route corresponding to a short mask.